"""tranos URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Add an import:  from blog import urls as blog_urls
    2. Import the include() function: from django.conf.urls import url, include
    3. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.conf import settings
from django.conf.urls.static import static

from tranos.base import views
from tranos.accounts import urls as accounts_urls
from tranos.images import urls as images_urls
from tranos.translations import urls as translations_urls
from captcha import urls as captcha_urls
from tinymce import urls as tinymce_urls

# 屏蔽 admin 自带登陆页面
admin.site.login = login_required(admin.site.login)


urlpatterns = [
    url(r'^feedback/$', views.feedback, name='feedback'),
    url(r'^accounts/', include(accounts_urls, namespace='accounts')),
    url(r'^images/', include(images_urls, namespace='images')),
    url(r'', include(translations_urls, namespace='translations')),
    url(r'^captcha/', include(captcha_urls)),
    url(r'^tinymce/', include(tinymce_urls)),
    url(r'^admin/', admin.site.urls),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
